import { notFound } from "next/navigation";
import type { Product } from "@/app/products-db/page";
import { getProduct } from "@/prisma-db";
import ProductEditPage from "./products-edit"


export default async function ProductsDBDetails({ params }: { params: Promise<{ id: string }> }) {
    const { id } = await params;
    const product: Product | null= await getProduct(parseInt(id));
    if (!product) {
        notFound();
    }
    return (
        <ProductEditPage product={product}/>
    )
}
